#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import piksemel
if len(sys.argv) != 3:
    print "Usage: \nrelease-xml FILE --screens\nrelease-xml FILE --slideshows\nrelease-xml --help"
else:
    doc = piksemel.parse(sys.argv[1])
    release_number = doc.getAttribute("number")
    print "Release %s" % release_number
    if sys.argv[2] == "--screens":
        screens = doc.getTag("screens")
        if screens:
            for screen in screens.tags("screen"):
                screen_title = screen.getTagData("_title")
                screen_icon = screen.getTagData("icon")
                screen_help = screen.getTagData("_help")

                print "Title:%s" % screen_title
                print "Icon:%s" % screen_icon
                print "Help:%s\n" % screen_help
    elif sys.argv[2] == "--slideshows":
        slideshows = doc.getTag("slideshows")
        if slideshows:
            for slideshow in slideshows.tags("slideshow"):
                slideshow_icon = slideshow.getTagData("icon")
                slideshow_description = slideshow.getTagData("_description")
                print "Icon:%s" % slideshow_icon
                print "Description:%s\n" % slideshow_description
